export default {
  state: {
    test: '1',
    apiLoadStatus: false,
    apiLoadText: 'Loading',
    themeColor: 'blue',
    pageOptions: {
      pageSizes: [5, 10, 20, 50, 100, 500],
      pageCount: 5
    },
    intOssLink: 'https://app.maibozhineng.com/oss/data-teams/users/photo/',
    prodOssLink: window.SITE_CONFIG['ossAddressURL'] + '/data-teams/users/photo/',
    redirectUri: window.location.origin + '/web/um/teams/redirect',
    microsoftClientId: '7a2f592b-0d0f-4529-82e3-3c8c4552f95e',
    isNewRegister: false,
    gadgetLayout: null,
    beforeLoginPage: null,
    beforeLoginParams: null,
    isNavToLogin: false,
    isSwitchTenant: 0,
    contentIsNeedRefreshCache: false,
    parameterKey: null,
    urlfromreportStatus: false,
    WebSocket: null,
    webSocketMessage: null,
    loginPath: null,
    portalAdmin: false,
    dayLeft: null,
    showNotice: false,
    downloadPdfList: [],
    theme: 'classic',
  },
  mutations: {
    SET_API_LOAD_STATUS: (state, apiLoadStatus) => {
      state.apiLoadStatus = apiLoadStatus
    },
    SET_API_LOAD_TEXT: (state, apiLoadText) => {
      state.apiLoadText = apiLoadText
    },
    SET_THEME_COLOR: (state, themeColor) => {
      state.themeColor = themeColor
    },
    SET_IS_NEW_REGISTER: (state, isNewRegister) => {
      state.isNewRegister = isNewRegister
    },
    SET_GADGET_LAYOUT: (state, gadgetLayout) => {
      state.gadgetLayout = gadgetLayout
    },
    SET_IS_SWITCH_TENANT: (state, isSwitchTenant) => {
      state.isSwitchTenant = isSwitchTenant
    },
    SET_CONTENT_IS_NEED_REFRESH_CACHE: (state, contentIsNeedRefreshCache) => {
      state.contentIsNeedRefreshCache = contentIsNeedRefreshCache
    },
    SET_PARAMETER_KEY: (state, parameterKey) => {
      state.parameterKey = parameterKey
    },
    URLFROMREPORTSTATUS: (state, data) => {
      state.urlfromreportStatus = data
    },
    SET_LOGIN_PATH: (state, loginPath) => {
      state.loginPath = loginPath
    },
    SET_PORTAL_ADMIN: (state, portalAdmin) => {
      state.portalAdmin = portalAdmin
    },
    SET_DAY_LEFT: (state) => {
      state.dayLeft = new Date().getTime()
    },
    SET_SHOW_NOTICE: (state, val) => {
      state.showNotice = val
    },
    SET_DOWNLOAD_PDF_LIST: (state, val) => {
      state.downloadPdfList = val
    },
    SET_THEME: (state, val) => {
      state.theme = val
    }
  },
  actions: {
    changeApiLoadStatus ({ commit }, weakFlag) {
      commit('SET_API_LOAD_STATUS', weakFlag)
    },
    setIsSwitchTenant ({ commit }, isSwitchTenant) {
      commit('SET_IS_SWITCH_TENANT', isSwitchTenant)
    },
    setContentIsNeedRefreshCache ({ commit }, contentIsNeedRefreshCache) {
      commit('SET_CONTENT_IS_NEED_REFRESH_CACHE', contentIsNeedRefreshCache)
    },
    setParameterKey ({ commit }, parameterKey) {
      commit('SET_PARAMETER_KEY', parameterKey)
    },
    setSetLoginPath ({ commit }, loginPath) {
      commit('SET_LOGIN_PATH', loginPath)
    },
    setPortalAdmin ({ commit }, portalAdmin) {
      commit('SET_PORTAL_ADMIN', portalAdmin)
    },
    setDayLeft ({ commit }) {
      commit('SET_DAY_LEFT')
    },
    setShowNotice ({ commit }, val) {
      commit('SET_SHOW_NOTICE', val)
    },
    setDownloadPdfList ({ commit }, val) {
      commit('SET_DOWNLOAD_PDF_LIST', val)
    },
    setTheme({ commit }, val) {
      commit('SET_THEME', val)
    }
  }
}
